Google-Developer-Student-Club-CCOEW / Competitive-Programming-2023-GDSC-CUMMINS-X-GDSC-MMCOE

Welcome to the Hacktoberfest 2023 Competitive-Programming Cohort for Cummins College and MMCOE students! To request issue assignment, create a pull request, providing: 1. Full Name 🧑‍🎓 2.Email 📧 3.College ID (RNO) 🔢 4.Branch of Study.📚 5. Year 📆 .The Cummins College and MMCOE students' PRs will be considered only. Thank you!
9 stars 69 forks source link

Permutations #137

Closed suryaprakashpandey closed 11 months ago

suryaprakashpandey commented 1 year ago

Write code in the preferred language and attach output with it.

A permutation of integers 1,2,…,n is called beautiful if there are no adjacent elements whose difference is 1.

Given n, construct a beautiful permutation if such a permutation exists.

Input The only input line contains an integer n.

Output Print a beautiful permutation of integers 1,2,…,n. If there are several solutions, you may print any of them. If there are no solutions, print "NO SOLUTION".

Example 1:

Input: 5 Output: 4 2 5 3 1

Example 2: Input: 3 Output: NO SOLUTION

anu-shka-k commented 12 months ago

Hi @suryaprakashpandey , could you please assign this issue to me? My solution will be in Python.

VaishnaviSaraf commented 12 months ago

hello , I am Vaishnavi Saraf from CCOEW Can you assign me this problem?

aditi3004 commented 11 months ago

I'm enthusiastic about contributing to this issue. May I kindly request the assignment of this issue? -Aditi Sharma TY CSE,CCOEW