Skip to content

Instantly share code, notes, and snippets.

View gauravbansal74's full-sized avatar
💻
Typing...

Gaurav Kumar gauravbansal74

💻
Typing...
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Sample Page</title>
<script src="js/main.js"></script>
<script src="js/utill.js"></script>
</head>
<body>
<p>Look at source or inspect the DOM to see how it works.</p>
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
@gauravbansal74
gauravbansal74 / BugfixingLeaderSorted
Last active January 13, 2018 07:16
Codility:BugfixingLeaderSorted
function solution(A) {
var n = A.length;
var L = new Array(n + 1);
L[0] = -1;
var i;
for (i = 0; i < n; i++) {
L[i + 1] = A[i];
}
var count = 0;
var pos = Math.floor((n/2)+1);
@gauravbansal74
gauravbansal74 / BinarySearchIndex.java
Created January 13, 2018 07:17
BinarySearchIndex
import java.util.Arrays;
public class BinarySearchIndex {
public static int binarySearchIndex(int[] arr, int item) {
int length = arr.length;
int hi = length-1;
int lo = 0;
class FizzBuzz {
public static void solution(int N) {
// write your code in Java SE 8
int count = 0;
int contCount = 0;
for(int i = 1; i<=N;i++){
if((i % 3 == 0) && (i % 5 == 0) && (i % 7 == 0)){
System.out.println("FizzBuzzWoof");
@gauravbansal74
gauravbansal74 / IsAnagramPalindrome.java
Created January 13, 2018 07:19
IsAnagramPalindrome
import java.util.*;
class IsAnagramPalindrome{
public static boolean isAnagramOfPalindrome(String s){
if(s.length() == 0){
return false;
}
if(s.length() == 1){
// you can also use imports, for example:
import java.util.*;
// you can write to stdout for debugging purposes, e.g.
// System.out.println("this is a debug message");
class Solution {
public int solution(int N) {
// write your code in Java SE 8
int count = 0;
import java.util.*;
// you can write to stdout for debugging purposes, e.g.
// System.out.println("this is a debug message");
class Solution {
public int solution(int[] A) {
// write your code in Java SE 8
int length = A.length;
int min = 0;