Skip to content

Instantly share code, notes, and snippets.

View parthsoni1912's full-sized avatar

parthsoni1912

View GitHub Profile
module Cube where
import Prelude
import Data.Tuple
import Data.Array (mapWithIndex, (!!))
import Data.Maybe (Maybe(..), fromMaybe)
import Halogen as H
import Halogen.HTML as HH
@parthsoni1912
parthsoni1912 / gist:3f6fec278ff786e075c0b86c7dcb303a
Last active March 13, 2021 10:10
GeeksForGeeks.Common Elements in three sorted arrays(EASIEST SOLUTION) in JAVA
### IN THIS_ISSUE SOME OF YOU MAYBE FACING (int not compatible) TYPE OF ISSUE. IN THAT CASE YOU SHOULD REPLACE <int> by <Integer>. AND HERE IS THE EASIEST SOLUTION. MUST UPVOTE IF U LIKE IT.
class Solution
{
ArrayList<Integer> commonElements(int A[], int B[], int C[], int n1, int n2, int n3)
{
ArrayList<Integer> arr=new ArrayList();
int x=0,y=0,z=0;
int count=0;
while(x<n1 && y<n2 && z<n3)
{