Skip to content

Instantly share code, notes, and snippets.

View joelsebbu's full-sized avatar
:octocat:
developing

JOEL J SEBASTIAN joelsebbu

:octocat:
developing
View GitHub Profile
@joelsebbu
joelsebbu / problem.txt
Created August 16, 2020 16:01
Coin Change
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:
@joelsebbu
joelsebbu / problem.txt
Created August 15, 2020 14:00
Kadane’s algorithm
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
@joelsebbu
joelsebbu / problem.txt
Last active August 13, 2020 12:11
Find First and Last Position of Element in Sorted Array
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]
@joelsebbu
joelsebbu / problem.txt
Created August 12, 2020 16:23
Water Bottles
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
@joelsebbu
joelsebbu / README.md
Created May 5, 2020 10:58 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store