• ###### kgashokcommented on "Counting Duplicates" kata

As you iterate through your list (`text` here),
you are conditionally removing elements from the list.
This will result in unpredictable behaviour.

If removal is necessary, iterate over a copy of the list
or use techniques such as iterating backwards
to avoid index shifting issues.

• ###### kgashokcommented on "Counting Duplicates" kata
``````for i in text:
...
for n in arr:
``````

`i` is case-sensitive and `n` is lower case.

• ###### kgashokcommented on "Counting Duplicates" kata

What language is this?

Thank you!

Thanks much

• ###### kgashokcommented on "Permute a Palindrome" kata

Your code is counting number of unique elements in the input. For the case of input `"aaabbb"`, your function computes an uniqueArr to be of length 0. And returns `true`, while the expected answer is `false`.

Instead, you must determine whether ONLY one element occcurs ODD number of times.

• For the case of input `"aaabbb"`, your logic would compute 2 (both `a` and `b` occur odd number of times). In this case, since it is more than one, your function should return false.
• For the case of input `"aaabbbb"`, your logic would compute 1 (only `a` occurs odd number of times). And therefore function should return true. (`bbaaabb` or `abbabba`would be valid palindromes).

I hope this helps!

• ###### kgashokcommented on ""Prime Factors" OCaml Translation"

Thank you very much!

• ###### kgashokcommented on "Permute a Palindrome" python solution

This comment is hidden because it contains spoiler information about the solution

• ###### kgashokcommented on "Basic Sequence Practice" kata

Node v18.x is what it is set to. What do you want to change it to?

When I try changing to assert.deepEqual, I get the following error:

``````    at Context.<anonymous> (test.js:23:10)
at process.processImmediate (node:internal/timers:471:21)
``````
• ###### kgashokresolved a question on "Counting Duplicates" kata

The problem (quite elementary) is the first line of code. Are you missing an assignment?

• ###### kgashokcommented on "Reverse List Order" c solution

Braces are optional (and therefore not used here) when there is only one statement inside the loop block. This implies that the return statement executes only after the while loop has completed. Hope this helps.

• ###### kgashokcommented on "longest_palindrome" kata

I would love to fix this.
But the scars of some very rude snobs here on CodeWars discourage me from trying anything new.

Thanks much!

• ###### kgashokcommented on "Permute a Palindrome" javascript solution

This comment is hidden because it contains spoiler information about the solution