Download code.cpp from dpv007/KeyStone: direct link, hf CLI and curl.
- Browser
- Download file 375 Bytes
-
https://huggingface.co/spaces/dpv007/KeyStone/resolve/main/code.cpp
- Command line
-
hf download hf://spaces/dpv007/KeyStone/code.cpp
-
curl -L -o code.cpp https://huggingface.co/spaces/dpv007/KeyStone/resolve/main/code.cpp
375 Bytes
| using namespace std; | |
| int lengthOfLongestSubstringKDistinct(string tickers, int k) { | |
| int j=0; | |
| int cnt=0; | |
| int maxc=0; | |
| for(int i=0;i<tickers.size();i++){ | |
| if(tickers[i]!=tickers[j]){ | |
| cnt = 1; | |
| j++; | |
| } | |
| else{ | |
| cnt++; | |
| } | |
| maxc = max(maxc,cnt); | |
| } | |
| return maxc; | |
| } |