Skip to content

Instantly share code, notes, and snippets.

View tdzl2003's full-sized avatar

DengYun tdzl2003

View GitHub Profile
class Solution {
public:
vector<vector<int>> modifiedGraphEdges(int n, vector<vector<int>>& edges, int source, int destination, int target) {
vector<vector<pair<int, int>>> graph(n);
for (int i = 0; i < edges.size(); i++) {
graph[edges[i][0]].push_back({ edges[i][1], i });
graph[edges[i][1]].push_back({ edges[i][0], i });
}
vector<int> route;
@tdzl2003
tdzl2003 / example.ts
Last active November 30, 2021 03:31
Build some distributed game simulation system.
import { action, Actor, state, World } from "./defines";
function wmc1616(state0: number, state1: number) {
state0 = 18030 * (state0 & 0xffff) + (state0 >> 16);
state1 = 30903 * (state1 & 0xffff) + (state1 >> 16);
return [
((((state0 & 0xffff) << 16) + (state1 & 0xffff)) >>> 0) / 2 ** 32,
state0,
state1,
];
@tdzl2003
tdzl2003 / index.js
Created October 27, 2016 06:12
Test of react native component
import React from 'react';
import { shallow } from 'enzyme';
import {
View, Text,
StyleSheet,
} from 'react-native';
const styles = StyleSheet.create({
container: {