There was an error while loading. Please reload this page.
1 parent 54f6cb1 commit 76210fbCopy full SHA for 76210fb
Algorithms/Detect Capital/detect-capital.js
@@ -0,0 +1,12 @@
1
+// Source : https://leetcode.com/problems/detect-capital/?tab=Description
2
+// Author : Han Zichi
3
+// Date : 2016-02-27
4
+
5
+/**
6
+ * @param {string} word
7
+ * @return {boolean}
8
+ */
9
+var detectCapitalUse = function(word) {
10
+ let p = /^([a-z]+|[A-Z]+|[A-Z]{1}[a-z]+)$/;
11
+ return p.test(word);
12
+};
0 commit comments