The Number of Beautiful Subsets at Infosys

Medium50.9% acceptance

This problem has 75.0% frequency at Infosys.

Problem Description

You are given an array `nums` of positive integers and a **positive** integer `k`. A subset of `nums` is **beautiful** if it does not contain two integers with an absolute difference equal to `k`. Return _the number of**non-empty beautiful** subsets of the array_ `nums`. A **subset** of `nums` is...

Read full problem and hints

Topics

Also asked at 3 companies


More Infosys Questions

View all Infosys questions