Ad
Code
Diff
  • g=w=>w?reverseGear(w.substr(1))+w.charAt(0):'';
    • reverseGear = word => word ?
    • reverseString(word.substr(1)) + word.charAt(0):"";
    • g=w=>w?reverseGear(w.substr(1))+w.charAt(0):'';
Code
Diff
  • x=lambda lst:sum(1 for item in lst if isinstance(item,bool)and item)
    solution=lambda lst:x(lst)>=2
    • def count_true_bools(lst):
    • return sum(1 for item in lst if isinstance(item, bool) and item)
    • def solution(lst):
    • return count_true_bools(lst) >= 2
    • x=lambda lst:sum(1 for item in lst if isinstance(item,bool)and item)
    • solution=lambda lst:x(lst)>=2
Code
Diff
  • solution=lambda param:sum(map(lambda p:p is True,param))>1
    • def solution(param): return sum([i for i in ([p is True for p in param])]) > 1
    • solution=lambda param:sum(map(lambda p:p is True,param))>1
Code
Diff
  • reverseGear=word=>word?reverseString(word.substr(1))+word.charAt(0):"";
    • const reverseGear = word => word === "" ? "" : reverseString(word.substr(1)) + word.charAt(0)
    • reverseGear=word=>word?reverseString(word.substr(1))+word.charAt(0):"";
Code
Diff
  • print("hello\n", 5, sep='')
    • print("hello", sum(range(2, 4)), sep='\n')
    • print("hello\n", 5, sep='')