Skip to content

Instantly share code, notes, and snippets.

View mangalvikas's full-sized avatar
🎯
Focusing

Vikas Kumar mangalvikas

🎯
Focusing
  • Adobe
  • Noida
View GitHub Profile
@mangalvikas
mangalvikas / smartprix_1.cpp
Last active October 4, 2017 20:14
asked in smartprix implement prototype for notepad, smartprix coding round, text editor utility
#include <bits/stdc++.h>
using namespace std;
char upper(char a){
if(a >= 97 && a<= 122){
return (char)((int)a-32);
}
return a;
}
int main() {
string s="",t;
@mangalvikas
mangalvikas / smartprix_2.cpp
Last active June 23, 2018 14:33
asked in smartprix implement a code which will take input as assembly code and ouput a the expected output of that code,smartprix coding round,assembly language output generater
#include<bits/stdc++.h>
using namespace std;
map<string,int>var;
void sett(string s,string ss){
if(var.find(ss) != var.end()){
var[s]=var[ss];
}else if(ss[0]>=48 && ss[0]<=57){
var[s]=stoi(ss);
}else{
var[s]=0;
#include <bits/stdc++.h>
using namespace std;
int func(int cur,int n,string str,long long int las){
if(cur==n){
return 1;
}
long long int sum=0;
long long int ans=0;
for(int i=cur;i<n;i++){
sum+=(str[i]-'0');
@mangalvikas
mangalvikas / EditDistance.cpp
Created November 6, 2016 13:23
This is a solution of Dynamic programming problem
#include<bits/stdc++.h>
using namespace std;
int min_dis(string s1,string s2){
int l1=s1.length();
int l2=s2.length();
int dp[l2+1][l1+1];
int i,j;
for(i=0;i<l1+1;i++){
dp[0][i]=i;
}
#include<stdio.h>
int main()
{
printf("hello");
return 0;
}
@mangalvikas
mangalvikas / HelpAshu.c
Created September 26, 2015 03:49
Help Ashu | Simple Segment tree
#include <stdio.h>
int tree[2*100000+4]={0};
long long int a[100000+4];
void build(int node,int start,int end)
{
if(start==end)
{
if(a[start]%2==0)
tree[node]=1;
else
@mangalvikas
mangalvikas / ThePro.c
Last active September 26, 2015 03:50
#include<stdio.h>
#include<stdlib.h>
int mod(int a){
if(a<0){
return (-1*a);
}
else return (a);
}
int main()
{