From a37fa0a205281b5ba206d18c88d770ccf5b448f5 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Sun, 23 Dec 2018 16:29:50 -0500 Subject: [PATCH] =?UTF-8?q?BinaryGap=20=20Test=20for=20codility=20?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=9A=84=E5=8E=9F=E6=96=87=E8=AF=B7=E5=8F=82?= =?UTF-8?q?=E8=80=83=E9=93=BE=E6=8E=A5=EF=BC=9A=20https://app.codility.com?= =?UTF-8?q?/programmers/lessons/1-iterations/binary=5Fgap/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 有关问题的解答思路和翻译,请参考:https://www.cwiki.us/display/ITCLASSIFICATION/Binary+Gap --- .../lintcode/LintCode1480DotProductTest.java | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/test/java/com/ossez/lang/tutorial/tests/lintcode/LintCode1480DotProductTest.java b/src/test/java/com/ossez/lang/tutorial/tests/lintcode/LintCode1480DotProductTest.java index e4ab2356ee..fb62a811a0 100644 --- a/src/test/java/com/ossez/lang/tutorial/tests/lintcode/LintCode1480DotProductTest.java +++ b/src/test/java/com/ossez/lang/tutorial/tests/lintcode/LintCode1480DotProductTest.java @@ -27,23 +27,9 @@ public class LintCode1480DotProductTest { @Test public void testMain() { logger.debug("BEGIN"); - int[] A = { 1, 1, -1 }; - int[] B = { 2147483647, 1, 3 }; - - int retStatus = 0; - - // LENGTH CHECK - if (A.length == 0 || B.length == 0 || A.length != B.length) - retStatus = -1; - - // ADDED - if (retStatus != -1) { - for (int i = 0; i < A.length; i++) { - retStatus = retStatus + A[i] * B[i]; - } - } - - System.out.println(retStatus); + int t = 87; + int[] dur = { 20, 25, 19, 37 }; + // Write your code here } }