Tag: Leet-code

  • How to reverse a string in Python 3

    How to reverse a string in Python 3

    To reverse a string in Python the bellow are the best ways so far: Write [::-1] to do slicing in Python starting at first character, until last, step by 1 in reverse (-1). It’s a pretty nice way to impress your imaginary friends. Option 1 Option 2 Whole code demo Write a comment or no,…

  • Find the missing number in an array

    Find the missing number in an array

    Computer science job interview question:Find the missing number in the series.Write a program to calculate the missing number in the series of integers. There are multiple ways to do this bu using the Gauss Sum addition method is a nice trick and it’s faster than any brute-force iteration you might think of.More info https://en.wikipedia.org/wiki/Gauss_sum The…