Skip to content

Instantly share code, notes, and snippets.

View AntiGameZ's full-sized avatar

Sijie Chen AntiGameZ

View GitHub Profile
This file has been truncated, but you can view the full file.
https://www.walmart.com/ip/401669095
https://www.walmart.com/ip/52647625
https://www.walmart.com/ip/411757560
https://www.walmart.com/ip/540826524
https://www.walmart.com/ip/881426838
https://www.walmart.com/ip/49229367
https://www.walmart.com/ip/46444962
https://www.walmart.com/ip/429509501
https://www.walmart.com/ip/46444966
https://www.walmart.com/ip/278693280
/**
* // This is the robot's control interface.
* // You should not implement it, or speculate about its implementation
* interface Robot {
* // Returns true if the cell in front is open and robot moves into the cell.
* // Returns false if the cell in front is blocked and robot stays in the current cell.
* public boolean move();
*
* // Robot will stay in the same cell after calling turnLeft/turnRight.
* // Each turn will be 90 degrees.
@AntiGameZ
AntiGameZ / LeetCodeTags.js
Last active May 31, 2018 00:30
LeetCode Tagers
let tagsArray = [];
let problems = Array.from(document.querySelectorAll("tbody.reactable-data tr")).map((ele) => {
let title = ele.querySelector("td[label=Title]").getAttribute('value')
let tags = Array.from(ele.querySelectorAll("td[label=Tags] a")).map(td => {
if (!isCompanyTag(td.textContent)) {
tagsArray.push({
tag: td.textContent,
title
})
public class PowerUp {
public string Name { get; set; }
public string Description { get; set; }
// becasue "Attribute" is conflict with C# keyword,
// so we need another name here.
public string Category { get; set; }
// Is it appropriate to use float type here?
public float BuffBase { get; set; }
public float BuffIncrement { get; set; }
public int Cost { get; set; }
public class ReconstructBinarySearchTreeWithPostorderTraversal {
public TreeNode reconstruct(int[] postOrder) {
int[] index = { postOrder.length - 1};
return helper(postOrder, index, Integer.MIN_VALUE);
}
private TreeNode helper(int[] postOrder, int[] index, int min) {
if (index[0] < 0 || postOrder[index[0]] <= min) {
package TwitterOA4;
public class MinimumMoves {
public int solution(int[] array, int[] target) {
// assumption:
// a) array and target contain same amount items.
// b) items in array and target have same digits.
// c) all position numbers.
int counter = 0;
for (int i = 0; i < array.length; i++) {
Q1: Minimum Moves:
给两个int[], 一个是a,一个是target,每次只能改变a[i]中的一位数(加一或者减一),问把所有a[i]变成target[i]所需要的minimum操作数。
e.g. 1234,4321 >> 2345, 3214: minimum moves : 4 + 6 = 10.
%10,Math.abs().
Q2: Twin Strings:.
给两个String[] a, b, 返回一个String[]. 如果a[i]和b[i]的odd index组成的string是anagram且even index组成的string是anagram, result[i]填进去“Yes",不是的话填“No”
注意a[i], b[i]的长度不一定相等,但a, b长度一定相等.1point3acres缃
int[] base = new int[26];(都是lowercase的)
@AntiGameZ
AntiGameZ / MaximumInIncreasingDecreasingArray.java
Created August 19, 2017 23:34
MaximumInIncreasingDecreasingArray
public int solution2(int[] input, int target) {
if (input == null || input.length == 0) {
return -1;
}
int left = 0;
int right = input.length - 1;
while (left <= right) {
int mid = left + (right - left) / 2;
void OnDrawGizmos()
{
Gizmos.color = new Color(9.0f, 1.0f, 1.0f, 0.3f);
Gizmos.DrawSphere(MoveToLoc, 2f);
Gizmos.color = Color.cyan;
Gizmos.DrawLine(transform.position + Vector3.one, MoveToLoc);
@AntiGameZ
AntiGameZ / The Technical Interview Cheat Sheet.md
Created June 17, 2017 21:49 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.