Coder Social home page Coder Social logo

aman22sharma / hacktoberfest2021_beginner Goto Github PK

View Code? Open in Web Editor NEW
94.0 3.0 281.0 2.06 MB

This Repository is for Hacktoberfest absolute beginners guide

License: MIT License

Python 100.00%
hacktoberfest goodfirstissue opensource contribution python3 biginner hacktoberfest2021

hacktoberfest2021_beginner's Issues

Add Custom Github issues and Pull request templates?

Add Custom Github issues and Pull request templates?

Hi, I want to add custom issues and PR templates to this repo. so, please tell me that which type of issue template(Linke NewProblem, Bug, etc).

Waiting for your reply.

Add your python concept

This issue is only for beginners.
In the Python3-Learn directory. You can add any python3 concepts.
Follow the contribution guidelines under README.md

  • Write a proper commit message - "Added-Python3-Python3conceptname"
    For example - Added-python3-variables

Finding Majority elements in list using python

Given an array nums of size n, return the majority element.
The majority element is the element that appears more than โŒŠn / 2โŒ‹ times. You may assume that the majority element always exists in the array.
Input: nums = [2,2,1,1,1,2,2]
Output: 2

### code:-
class Solution: def majorityElement(self, nums: List[int]) -> int: dict={} n = len(nums)/2 for ele in nums: try: dict[ele] += 1 except: dict[ele] = 1 for item in dict: if dict[item] >= n: return item

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.