How to Find a number which appears once and other numbers are twice ?

[Question]: In a given random array find a number which appears only single time Example : Random array input – [9,2,2,3,4,4,3] output = 9Solution: Step 1: Create a dictionary. Step 2: Create loop and fill the keys with element occurrence.Step 3: Create a loop and return the dictionary element which has only single occurrence .T …

How to Find a number which appears once and other numbers are twice ? Read More »

How to change text size in an iOS Simulator?

Xcode 14 onwardsSimulator ► Accessibility ► Display & Text Size ► Larger Text ► Select Font. Simulator ► Accessibility ► Display & Text Size ► Larger Text ► Select Font. If you wish to chose font for SwiftUI Preview Select device setting from bottom preview tab.You can see live font changes from SwiftUI code.

Quick Sort

Logic: Create a pivot element & arrange elements with two partitions, If the elements are lesser than pivot add it to left partition & if elements bigger than the pivot arrange it to right side of partition & make call recursively with the subarray found with same approach. Time Complexity: Avg O(n^2) .. Best: O(n …

Quick Sort Read More »

Merge Sort

Merge Sort is based on divide & conquer approach, first we divide array into two parts until we got single element then merge the single single element and create a subarray, Now merge two sorted subarray into single array likewise in final we got the final sorted array. In Conquer approach we have i, j …

Merge Sort Read More »