You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-10
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,4 @@ Problem 1.
7
7
8
8
Given a string of alphabets, determine whether a palindrome can be formed by rearranging the letters of the string.
9
9
10
-
For example, the string ‘abaab’ can be rearranged as ‘ababa’ to form a palindrome whereas the string ‘acccaa’ cannot be rearranged to form a palindome,
11
-
12
-
The program’s logic as explained in the club meeting is as follows:
13
-
14
-
1) Find the number of occurrences of each character in the word.
15
-
16
-
2) If there are more than two characters with an odd number of occurrences, a palindrome cannot be formed by shuffling the elements.
17
-
18
-
3) If there are no elements with an odd number of occurrence or if there is only one element with an odd number of occurrence, then a palindrome can be formed.
19
-
10
+
For example, the string ‘abaab’ can be rearranged as ‘ababa’ to form a palindrome whereas the string ‘acccaa’ cannot be rearranged to form a palindome.
0 commit comments