Introduction: The task is to test if a given string (s) can be a prefix of a given array (words). It is a String challenge usually asked at programming contests and coding rounds during the job interviews. Description: A string s is a prefix string of words if s can be made by concatenating theContinue reading “Check If String Is a Prefix of Array”
Category Archives: Leetcode
Optimizing the Two Sum Solution
Two Sum Leetcode in Swift by Farial Mahmod
Tower of Hanoi Solution in Swift
The “Tower of Hanoi” is a well known puzzle. There are 3 pegs with numbers 1, 2 and 3. N disks of different diameters are set on the first peg in the following order:The lower disk is set, the larger diameter it has. Your aim is to move all disks onto the second peg usingContinue reading “Tower of Hanoi Solution in Swift”
Sort The People (Leetcode)
Leetcode challenge solution using Swift.
