Instantly share code, notes, and snippets.

🎯
Focusing

# Shubham Patellifeisshubh

🎯
Focusing
• Sort options
Created Feb 19, 2019
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)
Created Feb 19, 2019
View intro.py
 import tensorflow as tf import numpy as np
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 &A) { int lastIndex = A.size()-1; int sz = A.size(); int i = 0; int checkUpTo = i+A[i]; int jumpCount = 1; while(i<=checkUpTo){
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 &A) { int sz = A.size(); int lastIndex = sz-1; int i = 0; int reachable = A[i]; while(i<=reachable){
Created Sep 30, 2018
View code_snip_1.ipynb
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 Solution::findSubstring(string A, const vector &B) { // For the result. vector res; // Calculating the no of sub-component available. int sz = B.size(); //cout << "totalComp" << " " << sz << endl;
Created Sep 18, 2018
View InterviewBit : Sudoku
 bool isfine(vector>& 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; }
Created Sep 15, 2018
View InterviewBit:Min Stack
 struct Node{ int val; struct Node * next; struct Node * nextMin; Node(int v){ val = v; next = NULL; nextMin = NULL; } };
Created Sep 13, 2018
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.