Skip to content

Consecutive Gap - Pegion Hole problem #81

@SharedMocha

Description

@SharedMocha

//Simple rules
//Sort the array
//Get no of buckets N = (length -1)
//Get gap between buckets GAP = (max -min/length-1)
//fill elements into buckets (i - min/ gap)
//Finally,get max by -->
// each bucket has max and min
// so min(i+1) -max(i) buckets

http://www.zrzahid.com/the-%E2%80%A9maximum%E2%80%A9-gap%E2%80%A9-problem-%E2%80%A9pigeonhole-%E2%80%A9principle%E2%80%A9/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions