Skip to content

Instantly share code, notes, and snippets.

View vikashvverma's full-sized avatar
🎯
Focusing

Vikash Verma vikashvverma

🎯
Focusing
View GitHub Profile
@vikashvverma
vikashvverma / Facebook Hacker Cup 2013 Beautiful Strings solution in java
Last active June 23, 2019 09:42
This is my implementation in java for Facebook Hacker Cup 2013 for Beautiful Strings problem
//visit http://vikash-thiswillgoaway.blogspot.com for solution of other problems
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.LineNumberReader;
import java.util.ArrayList;
import java.util.Collections;
/**
*
@vikashvverma
vikashvverma / Facebook Hacker Cup 2013 Solution : Balanced Smileys
Last active July 4, 2019 02:36
This is my solution for Facebook Hacker Cup 2013 in java :Balanced Smileys
The problem statement is given below:
Your friend John uses a lot of emoticons when you talk to him on Messenger. In addition to being a person who likes to express himself through emoticons, he hates unbalanced parenthesis so much that it makes him go :(
Sometimes he puts emoticons within parentheses, and you find it hard to tell if a parenthesis really is a parenthesis or part of an emoticon.
A message has balanced parentheses if it consists of one of the following:
1. An empty string ""
2. One or more of the following characters: 'a' to 'z', ' ' (a space) or ':' (a colon)
3. An open parenthesis '(', followed by a message with balanced parentheses, followed by a close parenthesis ')'.
4. A message with balanced parentheses followed by another message with balanced parentheses.
@vikashvverma
vikashvverma / Bubble Sort - C Program Source Code
Created January 30, 2013 22:03
Bubble Sort It’s a sorting algorithm, in which each pair of adjacent items are compared and swapped if they are in wrong order. The comparison is repeated until no swaps are needed, indicating that the list is sorted. The smaller elements ‘bubble’ to the top of the list, hence, the name Bubble Sort. In this like selection sort, after every pass …
#include<stdio.h>
/* Logic : Do the following thing until the list is sorted
(i) Compare two adjacent elements and check if they are in correct order(that is second one has
to be greater than the first).
(ii) Swap them if they are not in correct order.
*/
void BubbleSort(int *array,int number_of_elements)
{
int iter, temp, swapped;
do
@vikashvverma
vikashvverma / SumOfSubsets.java
Created April 8, 2013 14:26
This program implements sum of subset algorithm in java... :D
import java.util.Scanner;
/**
*
* @author VIK VIKKU VIKASHVVERMA VIKASH
* @since April 8, 2013
* @Website: http://vikash-thiswillgoaway.blogspot.com
*
*/
@vikashvverma
vikashvverma / sumofsub.c
Created April 8, 2013 14:28
This program implement sum of subset algorithm in C... :D
#include<stdio.h>
void sumOfSub(int,int,int);
static int m=0;
int*w;
int*x;
void main()
{ int i=0,sum=0,n=0;
printf("Enter size of array: ");
scanf("%d",&n);
@vikashvverma
vikashvverma / bitsindri.html
Created April 8, 2013 14:30
Blogger Template of BIT Sindri ( http://sindri-bit.blogspot.com )... :D
<!DOCTYPE html>
<html dir="ltr" lang="en-US"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta charset="UTF-8"/>
<meta content="" name="description"/>
<link href="http://www.bitsindri.ac.in/media/com_favicon/icons/1/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<title>BIT Sindri | Home Page</title>
<meta name="description" content="Vikku"/>
@vikashvverma
vikashvverma / MergeSort.java
Created April 8, 2013 14:33
Merge Sort program in JAVA... :D
/**
*
* @author VIK VIKKU VIKASHVVERMA VIKASH
* @since April 8, 2013
* @Website: http://vikash-thiswillgoaway.blogspot.com
*
*/
public class MergeSort {
@vikashvverma
vikashvverma / Level1.java
Last active December 16, 2015 12:19
CapgeminiTechChallenge:Level1
/**
*
* @author VIK VIKKU VIKASH VIKASHVVERMA
* @website vikash-thiswillgoaway.blogspot.in
*/
import java.io.*;
public class Level1
{
public static int median(int[] input1,int[] input2)
@vikashvverma
vikashvverma / RoadConstruction.java
Created April 22, 2013 11:12
CapgeminiTechChallenge:Leve2(RoadConstruction)
/**
*
*
* @author VIK VIKKU VIKASHVVERMA
* @website http://vikash-thiswillgoaway.blogspot.com
*/
public class RoadConstruction {
public static int minimum_weight(String[] input1, int[] input2) {
@vikashvverma
vikashvverma / DetectCycle.java
Created April 22, 2013 11:18
CapgeminiTechChallenge:Level3 (CarConstructionCompany)
import java.util.HashSet;
/**
* The program does not use proper approach, It is just a trick to score a reasonable marks on the challenge.
* The trick works upto certain extent, don't rely on this and develop the whole program on your own.
*
* @author VIK VIKKU VIKASH VIKASHVVERMA
* @website http://vikash-thiswillgoaway.blogspot.com