Ad
  • Custom User Avatar

    If we follow the best practice, a function should always return the same type. This will make it easy to translate the problem to languages such as C++ and Java. I would also encourage authors to use type hints in the Solution Setup code.

    from typing import Tuple, List
    
    
    def help_jack(protons: int, neutrons: int) -> Tuple[int, int, List[int], int]:
        # code here
    

    or if we allow the function to return strings too, then:

    from typing import Any
    
    
    def help_jack(protons: int, neutrons: int) -> Any:
        # code here
    
  • Custom User Avatar

    On top of what @voile pointed out, electrons are not always filled in the closest (least n) shell first. For example, 4s is filled before filling the 3d. That means first 2 electrons will be filled in n = 4 shell before completely filling the n = 3 shell. There is an (n+l) rule or Aufbau Principle which is used to understand this. And note that Aufbau Principle also has a few exceptions.

    https://en.wikipedia.org/wiki/Aufbau_principle

    https://byjus.com/chemistry/aufbau-principle/