For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
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 value N, if we want to make change for N cents, and we have infinite supply of each of coins = { S1, S2, .. , Sm} valued coins, how many ways can we make the change? | |
| Example 1: | |
| input: | |
| coins={2,3,5,10} | |
| n=15 | |
| output: | |
| 9 | |
| Example 2: |
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
| Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers which has the largest sum. | |
| example 1: | |
| input: 6,-6,4,8,-12 | |
| output: subarray: [2,3] | |
| max: 12 |
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 an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. | |
| Your algorithm's runtime complexity must be in the order of O(log n). | |
| If the target is not found in the array, return [-1, -1]. | |
| Example 1: | |
| Input: nums = [5,7,7,8,8,10], target = 8 | |
| Output: [3,4] |
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 'n' full water bottles, you can exchange 'f' empty water bottles for one full water bottle. | |
| The operation of drinking a full water bottle turns it into an empty bottle. | |
| Return the maximum number of water bottles you can drink. | |
| Example 1 | |
| Input: n = 9, f = 3 | |
| Output: 13 |