diff --git a/Number of Occurence b/Number of Occurence new file mode 100644 index 0000000..571a4cd --- /dev/null +++ b/Number of Occurence @@ -0,0 +1,21 @@ +class Solution{ +public: + /* if x is present in arr[] then returns the count + of occurrences of x, otherwise returns 0. */ + int count(int arr[], int n, int x) { + // code here + int cnt=0; + for(int i=0;i