Skip to content

Instantly share code, notes, and snippets.

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

cYpHeR cypher-nullbyte

🎯
Focusing
View GitHub Profile
//||||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>
@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
@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(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(help_the_doctor).txt
Last active May 13, 2020 18:59
Vpropel VIT | POD | 09/05/2020 | Help the doctor | 17
Help the doctor
Sabarish, A doctor forms a grid where each cell represents the condition of a patient.
The cell can take any of the three values as follows:
1-The person is virus free
2-The person is infected with the virus
3-Empty cell
@cypher-nullbyte
cypher-nullbyte / Question(eat_chocolates).txt
Created May 10, 2020 15:45
Vpropel VIT | POD | 10/05/2020 | Eat chocolates | 10
Eat chocolates
Ramesh wants to buy some chocolates. But there are some constraints that she needs to follow.
She can only buy “m” chocolates and can buy the chocolates of the same brand only up to a certain limit.
Given the cost and brand of the chocolates find the maximum cost at which she can buy the chocolates
Example1:-
Cost of chocolates:- [5,4,3,2,1]
Cost[i] represents the cost of ith chocolate
@cypher-nullbyte
cypher-nullbyte / Question(skipping_stones).txt
Created May 11, 2020 16:18
Vpropel VIT | POD | 11/05/2020 | Skipping Stones | 11
Skipping Stones
Yogee and his friends are playing skipping stones.
Each stone has a value which represents the maximum number of stones you can jump from that particular stone.
It was yogee’s turn. Given the value of every stones help him to find the minimum number of jumps required to
reach to the last stone provided that he starts from the first stone.
Assume you can always reach the last stone
Example:-
@cypher-nullbyte
cypher-nullbyte / Question(can_they_marry).txt
Last active May 13, 2020 15:28
Vpropel VIT | POD | 12/05/2020 | Can they Marry | 11
Can they Marry
Two strings A and B can marry each other if and only if we can swap any two letters in A so that the result equals B
Example:-
A=”ab”, B=”ba”
Yes, As when you swap a and b in A you will get “ba” which is B
A=”aa”, B=”aa”
@cypher-nullbyte
cypher-nullbyte / Question(Squares).txt
Created May 13, 2020 18:19
Vpropel VIT | POD | 13/05/2020 | Squares | 04
Squares
Every number can be expressed as sum of perfect squares.
For example
1= 1
So number of perfect squares required 1
2=1+1
@cypher-nullbyte
cypher-nullbyte / Question(train_routes).txt
Created May 14, 2020 18:10
Vpropel VIT | POD | 14/05/2020 | Train routes | 44
Train routes
A train stops on n stations numbered from 0 to n - 1 that form a circle.
We know the distance between all pairs of neighboring stations where distance[i] is the distance between the station number
i and (i + 1) % n.
The train goes along both directions i.e. clockwise and counterclockwise.
Return the shortest distance between the given start and destination stations.
Example:-