Do pythonic solutions count in interviews?

#1

Some python solutions are short and concise.

For example 12.1, checking for palindrome:

sum(v % 2 for v in collections.Counter(s).values()) <= 1

Will that suffice in interview settings, or will I need to implement the counting logic?

0 Likes

#2

On the same topic. For computing intersection (13.1) can we use the following or is too high level?

nums1=set(nums1)
nums2=set(nums2)
intersection = list(nums1&nums2)
0 Likes

#3

Hi @inoam,

Pythonic solutions are good for interview but not necessary in my opinion.

For your solution of 13.1, it is ok but the time complexity of that is high like “loop join” one we had.

0 Likes