---
title: "Comment by Biplob Manna on \"How I solved \"Sales by Match\" on HackerRank\" | Hashnode"
description: "Nice article! If I could provide some suggestion here, in the second for loop, all those lines of if conditions and isEven() function call can be reduced to pai"
url: "https://hashnode.com/posts/how-i-solved-sales-by-match-on-hackerrank/61f5feff66fcfc728be195fc/comment/61f62ea966fcfc728be198fe"
---

[Discussion](https://hashnode.com/posts/how-i-solved-sales-by-match-on-hackerrank/61f5feff66fcfc728be195fc)

Comment [How I solved "Sales by Match" on HackerRank](https://hashnode.com/posts/how-i-solved-sales-by-match-on-hackerrank/61f5feff66fcfc728be195fc)

[Biplob Manna](https://hashnode.com/@biplobmanna)

[Jan 30, 2022](https://hashnode.com/posts/how-i-solved-sales-by-match-on-hackerrank/61f5feff66fcfc728be195fc/comment/61f62ea966fcfc728be198fe)

Nice article!

If I could provide some suggestion here, in the second for loop, all those lines of `if` conditions and `isEven()` function call can be reduced to `pairs += counts[item] / 2 | 0` to get the integer division value.

```
for (const item in counts)
    pairs += counts[item] / 2 | 0;
```
