This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/4254389/git-corrupt-loose-object | |
Your best bet is probably to simply re-clone from the remote repo (ie. Github or other). Unfortunately you will lose any unpushed commits and stashed changes, however your working copy should remain intact. | |
First make a backup copy of your local files. Then do this from the root of your working tree: | |
rm -fr .git | |
git init | |
git remote add origin [your-git-remote-url] | |
git fetch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class Solution{ | |
public ArrayList<ArrayList<Integer>> permute(ArrayList<Integer> A) { | |
ArrayList<ArrayList<Integer>> big=new ArrayList<ArrayList<Integer>>(); | |
permute(big,A,0); | |
return big; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Solution { | |
public int divide(int A, int B) { | |
if(A==Integer.MIN_VALUE && B<0){ | |
return Integer.MAX_VALUE; | |
}else if(A==Integer.MIN_VALUE && B>0){ | |
return Integer.MIN_VALUE; | |
} | |
if(A==Integer.MAX_VALUE){ | |
return Integer.MAX_VALUE; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SlidingMaximum { | |
public ArrayList<Integer> slidingMaximum(final List<Integer> A,int B){ | |
int start=0; | |
ArrayList<Integer> result=new ArrayList<Integer>(); | |
PriorityQueue<Integer> pq=new PriorityQueue<Integer>(Collections.reverseOrder()); | |
for(int i=0;i<A.size();i++){ | |
while((i-start)!=(B-1)){ | |
pq.add(A.get(i)); | |
i++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Definition for binary tree | |
* class TreeNode { | |
* int val; | |
* TreeNode left; | |
* TreeNode right; | |
* TreeNode(int x) { | |
* val = x; | |
* left=null; | |
* right=null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Definition for binary tree | |
* class TreeNode { | |
* int val; | |
* TreeNode left; | |
* TreeNode right; | |
* TreeNode(int x) { | |
* val = x; | |
* left=null; | |
* right=null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
) | |
type ProjectAttributes struct{ | |
ProjectId string | |
Attributes map[string]map[string]string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//after = now.AddDate(2, 2, 5) | |
//fmt.Println("\nAdd multiple values:", after) | |
// time.Now().Local().Add(time.Hour*time.Duration(year) + | |
// time.Minute*time.Duration(month) + | |
// time.Second*time.Duration(day)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
//Workgroup example | |
func tie(wg *sync.WaitGroup) { | |
fmt.Println("Shiv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Factorial { | |
int sum(int n) | |
{ | |
int sm=0; | |
if(n==1) | |
return 1; | |
System.out.println("sm"+sm+"n"+n); | |
sm=n+sum(n-1); | |
System.out.println("sm"+sm); |