Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Shubham Patel lifeisshubh

🎯
Focusing
Block or report user

Report or block lifeisshubh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View intList.py
## creaing intList.
## This is a method that create IntList that feature seeks as input. value can
# take anything that is integer iterable.
# for example you can pass a set {3,4,6}, list [2,5,4], tuple (6,4,2).
# It is all good
intL = tf.train.Int64List(value=[3,4,5])
# Let see how it looks.
print(intL)
View intro.py
import tensorflow as tf
import numpy as np
@lifeisshubh
lifeisshubh / InterviewBit :: Min Jumps Array.cpp
Last active Oct 8, 2018
https://www.interviewbit.com/problems/min-jumps-array/ Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of jumps. Example : Given array A = [2,3,1,1,4] T…
View InterviewBit :: Min Jumps Array.cpp
int Solution::jump(vector<int> &A) {
int lastIndex = A.size()-1;
int sz = A.size();
int i = 0;
int checkUpTo = i+A[i];
int jumpCount = 1;
while(i<=checkUpTo){
@lifeisshubh
lifeisshubh / interviewBit_Jump_Game.cpp
Created Oct 8, 2018
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determine if you are able to reach the last index. For example: A = [2,3,1,1,4], return 1 ( true ). A = [3,2,1,0,4], return 0 ( false ). Return 0/1 for this problem
View interviewBit_Jump_Game.cpp
int Solution::canJump(vector<int> &A) {
int sz = A.size();
int lastIndex = sz-1;
int i = 0;
int reachable = A[i];
while(i<=reachable){
View code_snip_1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lifeisshubh
lifeisshubh / InterviewBit : Substring Concatenation
Created Sep 26, 2018
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters. Example : S: "barfoothefoobarman" L: ["foo", "bar"] You should return the indices: [0,9]. (order does not matter).
View InterviewBit : Substring Concatenation
vector<int> Solution::findSubstring(string A, const vector<string> &B) {
// For the result.
vector<int> res;
// Calculating the no of sub-component available.
int sz = B.size();
//cout << "totalComp" << " " << sz << endl;
View InterviewBit : Sudoku
bool isfine(vector<vector<int>>& res,int x,int y, int no){
int i,j,k;
for( i = 0; i < 9 ; i++ ){
if(res[x][i]==no || res[i][y]==no){
return false;
}
View InterviewBit:Min Stack
struct Node{
int val;
struct Node * next;
struct Node * nextMin;
Node(int v){
val = v;
next = NULL;
nextMin = NULL;
}
};
View InterviewBit : MergeSort on the Linked List
ListNode* merge(ListNode*A, ListNode*B){
ListNode * C;
ListNode * temp;
int i = 0;
while(A!=NULL && B!=NULL){
if(A->val > B->val){
if(i==0){
You can’t perform that action at this time.