Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ramagururadhakrishnan authored May 14, 2024
1 parent 9f85dd9 commit 594337d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Assets/Solutions/Mid-Term/Mid-Term.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#### 3. Write a function '_pairswap_' that swaps the elements of a list on a pair-wise basis.
Assumption: the list has an even number of elements.
Usage Example:
1. \> _pairswap_ [1..6]
1. \> _pairswap_ [1..6] <br/>
[2,1,4,3,6,5]
2. \> _pairswap_ "ammu"
2. \> _pairswap_ "ammu"<br/>
"maum"
3. \> _pairswap_ []
3. \> _pairswap_ [] <br/>
[]

**Solution:**
Expand Down Expand Up @@ -135,5 +135,6 @@ findMax (x:xs) = ???
```
findMax :: [Int] -> Int
findMax [x] = x
findMax (x:xs) = max$ x (findMax xs)
findMax (x:xs) = max x (findMax xs)
```
More variants of the solutions [here](Q10). <br/>

0 comments on commit 594337d

Please sign in to comment.