What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-24 03:41:34
Write a shell script that takes two strings as input and determines whether two strings are the anagram.
function isAnagram(stringA, stringB) { // Sanitizing stringA = stringA.toLowerCase().replace(/[\W_]+/g, ""); stringB = stringB.toLowerCase().replace(/[\W_]+/g, ""); // sorting const stringASorted = stringA.split(""... Add solution -
Other 2021-11-14 10:51:09
Give at least three examples that show different features of string slices. Describe the feature illustrated by each example. Invent your own examples. Do not copy them for the textbook or any other source.
print('Example 1: Substrings and every i-th character') string = 'Describe the feature illustrated by each example.' strA = string[0:9] strB = string[9::2] strC = string[10::2] listD = [x + y for x, y in zip(strB, strC)] string2 = strA + ''.join(lis... Add solution -
C++ 2021-10-20 19:28:09
finding all values of the mathematical expression
#define vi vector<int> vi evaluate_expressions(unordered_map<string, vi> &umap, string s){ if(umap.find(s) != umap.end()) return umap[s]; vi res = {}; if(s.find('+') == string::npos and s.find('-') == string::npos and s.... Add solution -
Python 2021-09-30 15:22:02
assert vs validate in python
from types import IntType, StringType def some_func(int_arg, str_arg, other_arg): assert type(int_arg) == IntType, "id is not an integer: %r" % int_arg assert type(str_arg) == StringType or not str_arg assert other_arg in (VALUE1, VA... Add solution -
Other 2021-09-27 17:53:02
program to perform fundamental string functions in c
///fundamental string operation, lenth, concatenation, compare and copy strings without string.h #include <stdio.h> #include <stdlib.h> int find_length(char string[]) { int len = 0, i; for (i = 0; string[i] != '\0'; i++) { len... Add solution
Best helpers
+10
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5