This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://leetcode.com/discuss/post/6686960/google-swe2-phone-screen-rejected-by-ano-ek6t/ | |
📌 Company: Google | |
📍 Round: Phone Screen | |
🧠 Role: SDE-2 | |
🗓️ Experience: 2 YOE | |
🧪 Question: Graph Connectivity via Value Proximity | |
Prompt: Given a sorted array arr of size N, and an integer diff, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Given a coke machine with a series of buttons. If you press a button it will get you a certain range of coke. | |
Find out if it's possible to get the target range of coke. You can press buttons any number of times. | |
Example 1: | |
Input: buttons = [[100, 120], [200, 240], [400, 410]], target = [100, 110] | |
Output: false | |
Explanation: if we press first button it might give us 120 volume of coke, not in the target range. | |
Example 2: |