AKAMAN KESHARWANIinamankesharwani.hashnode.dev·Jan 17, 2023 · 1 min readPython Recursion question 1Write a Python program to calculate the sum of a list of numbers. def list_sum(num_List): if len(num_List) == 1: return num_List[0] else: return num_List[0] + list_sum(num_List[1:]) print(list_sum([2, 4, 5, 6, 7]))00
AKAMAN KESHARWANIinamankesharwani.hashnode.dev·Jan 17, 2023 · 1 min readC++ and dsastring copy , compare , concat question . #include<iostream>#include<cstring>using namespace std; int main() { char a[1000] = "apple"; char b[1000]; // calc length cout << strlen(a) << endl; // strcpy strcpy(b,a); cout << b...00
AKAMAN KESHARWANIinamankesharwani.hashnode.dev·Jan 16, 2023 · 1 min readC++ and dsa question 1.Find Displacement : Given a long routes containing N,S,E,W directions, Find the shortest path to reach out the location. sample input :SNNNEWE Sample output : NNE solution : ------------- #include<iostream> using namespace std; int mai...00