Skip to content

Instantly share code, notes, and snippets.

View cypher-nullbyte's full-sized avatar
🎯
Focusing

cYpHeR cypher-nullbyte

🎯
Focusing
View GitHub Profile
@cypher-nullbyte
cypher-nullbyte / Question(water_and_jugs).txt
Created May 25, 2020 10:28
Vpropel VIT | POD | 24/05/2020 | Water and Jugs | 34
Water and Jugs
You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. You need to determine whether it is possible to measure exactly z litres using these two jugs.
If z liters of water is measurable, you must have z liters of water contained within one or both buckets by the end.
Operations allowed:
Fill any of the jugs completely with water.
Empty any of the jugs.
@cypher-nullbyte
cypher-nullbyte / Question(triplet_sum).txt
Last active May 18, 2020 18:16
Vpropel VIT | POD | 17/05/2020 | Triplet Sum | 38
Triplet Sum
Given an array of numbers find unique triplets such that the sum of the triplets is zero.
The solution set must not contain duplicate triplets.Find the number of such triplets in the array
Example:-
Given array nums = [-1, 0, 1, 2, -1, -4],
@cypher-nullbyte
cypher-nullbyte / Question(change_the_word).txt
Created May 15, 2020 21:31
Vpropel VIT | POD | 15/05/2020 | Change the word | 06
Change the word
You’ll be given with two words.You have to convert the first word to second with minimal number of operation.
You can add or delete or replace a character to word1.Find the minimal number of operation.
Example:-
Input: word1 = "intention", word2 = "execution"
Output: 5
@cypher-nullbyte
cypher-nullbyte / Question(point_to_point).txt
Last active May 16, 2020 08:35
Vpropel VIT | POD | 08/05/2020 | Point to Point | Similar to Frog Jump 404 LeetCode
Point to Point
Shyam is standing in Point A. He has to reach Point B. There are m number of divisions
between Point A and point B.
These division may or may not have a stone. One can jump only on the stone.
Given a list of stones positions (in division) in sorted ascending order,
determine whether Shyam can reach Point B.
@cypher-nullbyte
cypher-nullbyte / Question(Smash_the_potatoes).txt
Last active May 8, 2020 07:40
Vpropel VIT | POD | 07/05/2020 | Smash The Potatoes
We have a collection of potatoes, each potato has a positive integer weight.
Each turn, we choose the two heaviest potatoes and smash them together. Suppose the potatoes have weights x and y with x <= y. The result of this smash is:
If x = = y, both potatoes are totally destroyed;
If x ! = y, the potato of weight x is totally destroyed, and the potato of weight y has new weight y-x.
At the end, there is at most 1 potato left. Return the weight of this potato (or 0 if there are no potatoes left.)
Example:-
@cypher-nullbyte
cypher-nullbyte / Question( No Change ).text
Last active May 6, 2020 18:30
Vpropel VIT | POD | 06/05/2020 | No Change
No Change
Vikram’s mom gave him a certain amount of money and asked him to get change for the money in coins.
She also told the denominations of coin she wanted and also told the total number of coins must be minimum.
If that amount of money cannot be made up by any combination of the coins, print -1.
Example1:-
Let the Amount – 11
//||||Hola chicos{HEllo GUYS}, many students requested me to contribute this code. Here is your solution:)||||
//I have used STL and created the program using Pure Object Oriented Paradigm.
// This code tried to solve the problem considering TIME_COMPLEXITY.
// The algorithm and schema can be improved though.
// https://vitspot.com/code/amount-remaining-after-shopping/
// Else go to bottom of file, to read the whole question.
#include<iostream>
#include<string>
#include<tuple>
#include<vector>