Socket
Socket
Sign inDemoInstall

findpattern

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.0.4

2

package.json
{
"name": "findpattern",
"version": "0.0.3",
"version": "0.0.4",
"description": "I am tired of this s**t",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -15,2 +15,7 @@

# EXAMPLE
So, I see that some test asking for a solution like this... enjoy!
"The test ask to have count of groups pr count of word of subsequence"
```javascript

@@ -34,14 +39,29 @@ const findPattern = ( word ) => {

};
// test it:
console.log( findPattern('abcabc') ); // -> 2 groups
console.log( findPattern('cccc') ); // -> 4 chars
```
## HOW IT'S WORKS
# ANOTHER EXAMPLE
test it:
So, I see that some test asking for a solution like this... enjoy!
"The test ask to have the length about on not repeated subsequence"
```javascript
// 'abcabc' = 2 groups
console.log( findPattern('abcabc') );
var findPattern = function( word ) {
const count = new Set(word);
return count.size;
};
// test it:
// cccc = 4 repeated chars
console.log( findPattern('cccc') );
console.log( findPattern('abcabc') ); // -> 3
console.log( findPattern('cccc') ); // -> 1
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc