In this kata, you will write a function that returns the positions and the values of the "peaks" (or local maxima) of a numeric array.

For example, the array `arr = [0, 1, 2, 5, 1, 0]` has a peak at position `3` with a value of `5` (since `arr[3]` equals `5`).

~~~if-not:php,cpp,java,csharp
The output will be returned as an object with two properties: pos and peaks. Both of these properties should be arrays. If there is no peak in the given array, then the output should be `{pos: [], peaks: []}`.
~~~
~~~if:php
The output will be returned as an associative array with two key-value pairs: `'pos'` and `'peaks'`.  Both of them should be (non-associative) arrays.  If there is no peak in the given array, simply return `['pos' => [], 'peaks' => []]`.
~~~
~~~if:cpp
The output will be returned as an object of type `PeakData` which has two members: `pos` and `peaks`.  Both of these members should be `vector`s.  If there is no peak in the given array then the output should be a `PeakData` with an empty vector for both the `pos` and `peaks` members.

`PeakData` is defined in Preloaded as follows:

~~~
~~~if:java
The output will be returned as a ``Map>` with two key-value pairs: `"pos"` and `"peaks"`. If there is no peak in the given array, simply return `{"pos" => [], "peaks" => []}`.
~~~
~~~if:csharp
The output will be returned as a `Dictionary>` with two key-value pairs: `"pos"` and `"peaks"`. 
If there is no peak in the given array, simply return `{"pos" => new List(), "peaks" => new List()}`.
~~~

Example: `pickPeaks([3, 2, 3, 6, 4, 1, 2, 3, 2, 1, 2, 3])` should return `{pos: [3, 7], peaks: [6, 3]}` (or equivalent in other languages)

All input arrays will be valid integer arrays (although it could still be empty), so you won't need to validate the input.

The first and last elements of the array will not be considered as peaks (in the context of a mathematical function, we don't know what is after and before and therefore, we don't know if it is a peak or not).

Also, beware of plateaus !!! `[1, 2, 2, 2, 1]` has a peak while `[1, 2, 2, 2, 3]` does not. In case of a plateau-peak, please only return the position and value of the beginning of the plateau. For example: 
`pickPeaks([1, 2, 2, 2, 1])` returns `{pos: [1], peaks: [2]}` (or equivalent in other languages)

Have fun!

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

def _disabled_input(*args, **kwargs):
    raise RuntimeError("input() is disabled in callable mode")
builtins.input = _disabled_input

ns = {"__name__": "__judge__"}  # prevent if __name__ == "__main__" blocks
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'def pick_peaks(arr):\n    return_dict = {"pos": [], "peaks": []}\n    fall = False\n    peak = False\n    plateaus_after_peak = False\n    plateaus = False\n    plateaus_pos = 0\n\n    for position, current in enumerate(arr):\n\n        if position == 0:\n            print(f"[{position}] {current} - START")\n        elif position == len(arr) - 1:\n            print(f"[{position}] {current} - END")\n\n        else:\n\n            next = arr[position + 1]\n            previous = arr[position - 1]\n\n            if previous > current < next:\n                fall = True\n                peak = False\n                plateaus_after_peak = False\n                plateaus = False\n                print(f"[{position}] {current} - Fell!")\n\n            elif previous > current > next:\n                fall = True\n                peak = False\n                plateaus_after_peak = False\n                plateaus = False\n                print(f"[{position}] {current} - Falling...")\n\n            elif previous < current < next:\n                fall = False\n                peak = False\n                plateaus_after_peak = False\n                plateaus = False\n                print(f"[{position}] {current} - Rising...")\n\n            elif previous < current == next:\n                fall = False\n                peak = True\n                plateaus_after_peak = False\n                plateaus = True\n                plateaus_pos = position\n                print(f"[{position}] {current} - Plateaus start!")\n\n            elif previous == current > next:\n\n                if position == 1:\n                    print(f"[{position}] {current} - End of starting plateaus!")\n\n                # jeśli nie drugi i nie przedostatni\n                elif position != 1 and position != len(arr) - 2:\n\n                    if plateaus_after_peak:\n                        fall = True\n                        peak = False\n                        plateaus_after_peak = False\n                        plateaus = False\n                        print(f"[{position}] {current} - Plateus End after peak - Falling...")\n\n                    else:\n                        fall = True\n                        peak = False\n                        plateaus_after_peak = False\n                        plateaus = False\n                        print(f"[{position}] {current} - End of plateaus! Falling, saving the start of plateaus!")\n                        return_dict["pos"].append(plateaus_pos)\n                        return_dict["peaks"].append(current)\n                elif position == len(arr) - 2 and current > next and not plateaus_after_peak:\n                    fall = True\n                    peak = False\n                    plateaus_after_peak = False\n                    plateaus = False\n                    print(f"[{position}] {current} - End of plateaus! Falling, saving the start of plateaus!")\n                    return_dict["pos"].append(plateaus_pos)\n                    return_dict["peaks"].append(current)\n\n            elif previous > current == next:\n                fall = False\n                peak = False\n                plateaus_after_peak = True\n                plateaus = True\n                print(f"[{position}] {current} - Plateus start after a peak!")\n\n            elif previous < current > next:\n                fall = False\n                peak = True\n                plateaus_after_peak = False\n                plateaus = False\n                print(f"[{position}] {current} - Its a peak! Saving")\n                return_dict["pos"].append(position)\n                return_dict["peaks"].append(current)\n\n            elif previous == current == next:\n                fall = False\n                plateaus = True\n                print(f"[{position}] {current} - Plateus Flat!")\n            elif previous == current < next:\n                if plateaus_after_peak:\n                    fall = True\n                    peak = False\n                    plateaus_after_peak = False\n                    plateaus = False\n                    print(f"[{position}] {current} - Plateus End after peak - Rising...")\n            elif plateaus:\n                if position + 1 == len(arr) - 1: #jesli nie jest przedostatni\n                    if not plateaus_after_peak:\n                        fall = False\n                        peak = True\n                        plateaus_after_peak = False\n                        plateaus = False\n                        print(f"[{position}] {current} - Plateus Before End")\n                        return_dict["pos"].append(plateaus_pos)\n                        return_dict["peaks"].append(current)\n                    else:\n                        print(f"[{position}] {current} - X1!")\n                else:\n                    print(f"[{position}] {current} - X2!")\n\n            else:\n                print(f"[{position}] {current} - OUTSIDE!")\n\n    return return_dict'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

_target = None
_fn_name = 'pick_peaks'
if _fn_name:
    if "Solution" in ns:
        try:
            _obj = ns["Solution"]()
            if hasattr(_obj, _fn_name):
                _target = getattr(_obj, _fn_name)
        except Exception:
            _target = None
    if _target is None and _fn_name in ns and callable(ns[_fn_name]):
        _target = ns[_fn_name]
# Fallback: if there's exactly one user-defined function, use it
if _target is None:
    _cands = [v for k, v in ns.items() if callable(v) and getattr(v, "__module__", "") in ("__judge__", "__main__")]
    _user_funcs = [c for c in _cands if getattr(c, "__name__", "").startswith("_") is False]
    if len(_user_funcs) == 1:
        _target = _user_funcs[0]
if _target is None:
    raise RuntimeError(f"Could not resolve callable '{_fn_name}'")

_raw = sys.stdin.read().strip()
if _raw:
    _parsed = json.loads(_raw)
    if isinstance(_parsed, dict):
        _kwargs = _parsed.get("kwargs", {})
        _args = _parsed.get("args", [])
    else:
        _args, _kwargs = _parsed, {}
else:
    _args, _kwargs = [], {}
if not isinstance(_args, (list, tuple)):
    _args = [_args]
_res = _target(*_args, **_kwargs)
try:
    sys.stdout.write(repr(_res) + "\n")
except Exception:
    pass

```

Measured memory_bytes: 8744