Google India | Phone Screen | L4
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2024-10-30Added By Anonymous
Source:Ā Link
š§ Experience: unknown
ā Outcome: unknown
š° Compensation: unknown
š Location: India
š¢ Company: Google
š Education: unknown
š Benefits: unknown
š Offer Date: unknown
Suppose that you have an assortment of lego blocks, they're all height 1 and width 1 but can have varying lengths. The lengths of the blocks will be an input of the program and you have an infinite number of each block length. (So available_block_lengths = []int) You want to build a wall of length X and height H, in such a way that the intersection of two blocks in one layer never lines up with the intersection of two blocks in a different layer. Given this information, output the number of different valid permutations in which such a wall can be built with the available blocks. So for example, if we had blocks of length 1 and 2 and the wall width was 3 and height 3, the output should be 2: |oo|o| |o|oo| |oo|o| And |o|oo| |oo|o| |o|oo|
ā Outcome: unknown
š° Compensation: unknown
š Location: India
š¢ Company: Google
š Education: unknown
š Benefits: unknown
š Offer Date: unknown
Suppose that you have an assortment of lego blocks, they're all height 1 and width 1 but can have varying lengths. The lengths of the blocks will be an input of the program and you have an infinite number of each block length. (So available_block_lengths = []int) You want to build a wall of length X and height H, in such a way that the intersection of two blocks in one layer never lines up with the intersection of two blocks in a different layer. Given this information, output the number of different valid permutations in which such a wall can be built with the available blocks. So for example, if we had blocks of length 1 and 2 and the wall width was 3 and height 3, the output should be 2: |oo|o| |o|oo| |oo|o| And |o|oo| |oo|o| |o|oo|