allaboutjst / airbnb Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
When s.length() == 0
, root.isLeaf
should be marked as True
. Otherwise, when input list contains ""
, it will go wrong.
Guessing the highest '+' on column 5 needs to be adjusted like below; currently it's one space to the left which doesn't make sense with the posted example solution.
+
++ +
++ + ++
+++ +++ ++
++++++++ +++
++++++++++++
012345678901
link has boggle_gane instead of boggle_game
public static class UnitTest {
@test
public void test1() {
Solution sol = new IPRangetoCIDR().new Solution();
List res = sol.ipRange2Cidr("255.0.0.7", 10);
assertEquals(3, res.size());
assertEquals("255.0.0.7/32", res.get(0));
assertEquals("255.0.0.8/29", res.get(1));
assertEquals("255.0.0.16/32", res.get(2));
res = sol.ipRange2Cidr("1.1.1.0", 4);
assertEquals(1, res.size());
assertEquals("1.1.1.0/30", res.get(0));
res = sol.ipRange2Cidr("1.1.1.1", 4);
assertEquals(3, res.size());
assertEquals("1.1.1.1/32", res.get(0));
assertEquals("1.1.1.2/31", res.get(1));
assertEquals("1.1.1.4/32", res.get(2));
}
}
I think "assertEquals("1.1.1.4/32", res.get(2));"
should be :"assertEquals("1.1.1.4/31", res.get(2));"
arr = new double[]{1.2, 2.5, 3.6, 4.0};
res = sol.roundUp(arr);
assertEquals(4, res[0]);
assertEquals(3, res[1]);
assertEquals(2, res[2]);
assertEquals(1, res[3]);
I think the answer might be 1, 2, 4, 4
List<List> testcase = new ArrayList<>();
testcase.add(new ArrayList() {{
add(1);
add(2);
}});
testcase.add(new ArrayList() {{
add(3);
}});
testcase.add(new ArrayList() {{
add(4);
add(5);
add(6);
}});
TwoDIterator2 t = new TwoDIterator2(testcase);
t.next();
t.next();
t.hasNext();//this one move the colIt to next List's begin, but next move need to remove previous one, you need to bak up that one.
t.remove();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.